package com.tridion.utilities.verifier;

import java.io.File;

import com.tridion.utilities.verifier.analyzer.AnalyzerManager;
import com.tridion.utilities.verifier.model.ContentDeliveryInstallation;
import com.tridion.utilities.verifier.reports.SimpleTextualReport;

public class Verifier {

    /**
     * @param args
     */
    public static void main(String[] args) {
        if (args != null && args.length > 0) {
            final String folderLocation = args[0];
            final File folder = new File(folderLocation);
            if (folder.exists() && folder.isDirectory()) {
                // create our manager
                final AnalyzerManager analyzer = new AnalyzerManager();
                
                // start the analyze process
                final ContentDeliveryInstallation cdi = analyzer.analyze(folder);
                
                // report on the analyzed data
                SimpleTextualReport.generateReport(cdi);
            } else {
                System.out.println("Given folder is not valid root location");
            }
        } else {
            System.out.println("Usage: java -jar <jar_file>.jar <rootLocation>");
        }
    }
}
